package com.per;

import com.per.mybootall.es.canal.CanalListerner;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author yuan
 */
@SpringBootApplication
@EnableTransactionManagement
@MapperScan({"mappers","com.per.mybootall.dao","com.per.mybootall.moreDatasourse"})
@EnableSwagger2
public class MybootallApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(MybootallApplication.class, args);
    }

    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }

    @Override
    public void run(String... args) throws Exception {
        CanalListerner canalListerner=new CanalListerner();
        canalListerner.afterPropertiesSet();
    }
}
